var baseData={
    tree: null,
    sysDataId:"",
    sysOrgId:"",
    cdcRoomId:""
}

baseData.enter=function(id,value){
    alert(value);
}
baseData.treeClick=function(e, treeId, treeNode) {
    if(!treeNode.isParent){
        var tabs=$('#baseDataTabs').tabs('tabs');
        var tabLen=tabs.length;
        for (var index = tabLen-1; index >0; index--) {
            $('#baseDataTabs').tabs('close',index);
        }
    
        var url="/cdc/cdc";
        baseData.sysDataId=treeNode.id;
        baseData.sysOrgId=treeNode.pId;
        var ajax = new $ax(Sys.backendPath + "/cdc/datatable/table", function (data) {
            for (var index = 0; index < data[0].length; index++) {
                var code = data[0][index];
                var name = data[1][index];
                var newUrl=url+code;
                $('#baseDataTabs').tabs('add',{
                    title: name,
                    fit:true,
                    selected: false,
                    content: '<iframe scrolling="auto" frameborder="0" src="' + newUrl + '" style="width:100%;height:99%;" onload="Sys.closeLoading();"></iframe>'
                });
            }
            $('#baseDataTabs').tabs('select',1);
        }, function (data) {
            Sys.error("数据获取失败!");
        });
        ajax.set("sysDataId", baseData.sysDataId);
        ajax.start();
    }
 }
var ztree = new $ZTree("prodataTree", Sys.backendPath + "/cdc/cdcdata/tree/null/base");
ztree.bindOnClick(baseData.treeClick);
ztree.init();
baseData.tree=ztree;